﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using YLPublicService.TransferModel;

namespace YLServerInterface.Forms
{
    [ValueConversion(typeof(TemplateItem), typeof(TemplateItem.TemplateDetial))]
    public class GetTemplateDetialConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var t = value as TemplateItem;
            if (t == null)
            {
                return null;
            }
            return t.mTemplateDetial;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    [ValueConversion(typeof(object), typeof(object))]
    public class EchoConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var t = value as TemplateItem;
            if (t == null)
            {
                return null;
            }
            return t.mTemplateDetial;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
